Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Type_Dontcare for _ expressions in table entries #3444

Merged
merged 1 commit into from
Jul 25, 2022

Conversation

mihaibudiu
Copy link
Contributor

Signed-off-by: Mihai Budiu [email protected]
Fixes #3442
For this to work we need to remember whether the original expression was _ or { _ }.
That's why the IR class had to be augmented.
(We may need to do the same for select expressions, which suffer from a similar confusion.)

@vgurevich
Copy link

I would hold off merging this until we resolve p4lang/p4-spec#1120.
I wonder if there is any other case, where we will need to unify _ with tuple<>

@mihaibudiu
Copy link
Contributor Author

This is a bug, _ should unify with everything.
The solution should be different if you want such tables to be empty.

@jnfoster
Copy link
Contributor

jnfoster commented Jul 20, 2022 via email

@vgurevich
Copy link

No problem -- but then get ready to deal with the fallout :)

@mihaibudiu mihaibudiu requested a review from rst0git July 22, 2022 16:13
Copy link
Member

@rst0git rst0git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I can confirm that the patch in this pull request fixes the error in #3442

@mihaibudiu mihaibudiu merged commit 34c99ec into p4lang:main Jul 25, 2022
@mihaibudiu mihaibudiu deleted the issue3442 branch July 25, 2022 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Underscore has wrong type
4 participants